<template>
  <div class="iconText">
    <div v-for="(item, index) in newIconTextList" class="iconContent">
      <div class="containerIcon" @click="showModal(item)">
        <img :src="item.icon" class="iconfont" />
      </div>
      <div class="textDown" @click="showModal(item)">{{ item.name }}</div>
    </div>
  </div>
</template>
<script>
export default {
  name: "iconText",
  props: {
    iconTextList: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    newIconTextList: function() {
      return this.iconTextList.filter(item => {
        return item.show;
      });
    }
  },
  methods: {
    showModal(item) {
      this.$emit("showModal", item);
    }
  }
};
</script>
<style lang="less" scoped>
.iconText {
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: center;
  .iconContent {
    text-align: center;
    // margin: 10px 90px 5px 0px;
    margin: 10px 30px 5px 20px;
    .containerIcon {
      background: #f6f9fe;
      margin: 0 19px 5px;
      width: 72px;
      height: 72px;
      border-radius: 12px;
      cursor: pointer;
      .iconfont {
        width: 72px;
        height: 72px;
        color: #386bd7;
      }
    }
    .textDown {
      width: 110px;
      height: 44px;
      line-height: 22px;
      text-align: center;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      cursor: pointer;
      // &:hover {
      //   color: #386bd7;
      // }
    }
  }
}
</style>